package org.conducta.ui.swing.fixture;

import java.util.ArrayList;
import java.util.List;
import org.fest.swing.fixture.JCheckBoxFixture;

/**
 *
 * @author Stoyan Vassilev
 */
public class JCheckBoxGroupFixture {
    private final List<JCheckBoxFixture> m_checkBoxFixtures;

    public JCheckBoxGroupFixture(JCheckBoxFixture... checkBoxFixtures) {
        m_checkBoxFixtures = new ArrayList<JCheckBoxFixture>();
        for (JCheckBoxFixture radioFixture : checkBoxFixtures) {
            m_checkBoxFixtures.add(radioFixture);
        }
    }
    
    public JCheckBoxFixture findByText(String text)
    {
       for (JCheckBoxFixture checkFixture : m_checkBoxFixtures) {
          if (text.equals(checkFixture.text()))
          {
            return checkFixture;
          }
       }
       return null;
    }
    
    public List<JCheckBoxFixture>  findByText(List<String> texts)
    {
       List<JCheckBoxFixture> checkBoxes = new ArrayList<JCheckBoxFixture>();
       for (JCheckBoxFixture checkFixture : m_checkBoxFixtures) {
          if (texts.contains(checkFixture.text()))
          {
            checkBoxes.add(checkFixture);
          }
       }
       return checkBoxes;
    }
}
